------------------------------------------------------------------
--                             Field                            --
------------------------------------------------------------------
with Ada.Streams;

package Field is

   type Field_Type is tagged limited private;
   type Field_Ref is access all Field_Type'Class;

   procedure Deposit (A : in out Account_Type;
                      Value : in Natural);

   procedure Withdraw (A : in out Account_Type;
                       Value : in Natural);

   function Balance (A : Account_Type) return Natural;

   Not_Enough_Funds : exception;

private

    type Field_Type is tagged limited record
	   -- dimensioni del campo standard (variabili in base all'inizializzatore)
	   NumRows : Integer := 204;
	   NumCols : Integer := 315;
 
	   -- posizione delle porte
	   Goal_1_Stake_1 : Position := (30, 92, 315);
	   Goal_1_Stake_2 : Position := (31, 112, 315);
	   Goal_2_Stake_1 : Position := (32, 92, 0);
	   Goal_2_Stake_2 : Position := (33, 112, 0);
	           
	   -- array di posizionamento dei giocatori
	   PList : PositionList;
    end record;

   procedure My_Write (Stream : access Ada.Streams.Root_Stream_Type'Class;
                       Item   : in Account_Type);
   for Account_Type'Write use My_Write;

   procedure My_Read (Stream : access Ada.Streams.Root_Stream_Type'Class;
                      Item   : out Account_Type);
   for Account_Type'Read use My_Read;

end Accounts;
